package ar.uba.fi.tonyvaliente.commands;

public class CreditsCommand extends Command {

	private boolean recognized;

	public CreditsCommand(String[] args) {
		super(args);

		recognized = false;

		if (args.length > 0) {
			String command = args[0];
			command = command.toLowerCase();
			if (command.equals("-credits")) {
				recognized = true;
			}
		}
	}

	public CommandResult execute() {
		if (!recognized)
			return CommandResult.NOT_RECOGNIZED;

		StringBuffer buffer = new StringBuffer();

		buffer.append("Trabajo práctico para la materia Organización de Datos - Catedra Servetto\n");
		buffer.append("2do Cuatrimestre 2008\n\n");
		buffer.append("Tony Valiente Development Team\n");
		buffer.append("    Nicolas Risaro  (84623) nrisaro@gmail.com\n");
		buffer.append("    Diego Morello   (81620) diego.morello@gmail.com\n");
		buffer.append("    Gabriel Falcone (79328) gabrielfalcone@gmail.com\n");

		return new CommandResult(true, true, buffer.toString());
	}

	public String getSignature() {
		return "-credits";
	}

	public String getDescription() {
		return "Show credits :-)";
	}

	public String[] getExamples() {
		return new String[] { "-credits" };
	}
}
